package ThreadDemo;

public class ThreadDemo7 {
    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            try {
                System.out.println("进入睡眠5秒");
                Thread.sleep(5000);
                System.out.println("5秒后睡眠结束");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
        t1.interrupt();
        t1.start();

    }
}
